<?php

namespace app\validate;

use share\validate\SceneValidate;

class DeviceGroupTableValidate extends SceneValidate{

    protected $rule = [
        'state' => 'require|min:16',
        'encode' => 'require|min:30',
        'userId' => 'require|min:30',
        'token' => 'require|min:30',
        'userIdentity' => 'require|min:10',
        'serverSite' => 'require|min:1|max:10',
        'info' => 'require|array|min:1|max:10',
        'deviceName' => 'require|min:10|max:120',
        'productKey' => 'require|min:10|max:120',
        'queryTime' => 'require|number|>:1',
        'iotId' => 'require|min:10|max:64',
        'chNum' => 'require|number|>=:0|<=:512',
        'deviceType' => 'require|integer',
        'vendor' => 'require|length:2,60',
        'groupIds' => 'array',
        'groupId' => 'length:1,64',
        'groupName' => 'require|length:1,250',
        'chanNum' => 'require|number|>=:0|<=:16',
        'deviceList' => 'require|array',
        'channel' => 'require|integer|<=:16',
        'mainId' =>  'require|length:10,64',
        'subId' =>  'require|length:10,64',
        'owned' =>  'require|length:1',
        'deviceChannel' => 'require|integer',
    ];    

    protected $scene = [
        'list' => ['vendor','queryTime','groupIds','userId','token','state','encode'],
        'set' => ['vendor','queryTime','groupId','groupName','chanNum','deviceList','userId','token','state','encode'],
        'deviceListDetail' => ['channel','mainId','subId','owned','deviceChannel'],
        'del' => ['vendor','queryTime','groupIds','userId','token','state','encode'],
    ];
}